package com.base.cn.platform.os.service.manage.group;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.manage.BaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 部门接口
 *
 * @author s.li
 * @create 2018-04-03-10:51
 */
@FeignClient(name = BaseService.appName,configuration = FeignAuthConfig.class)
public interface SysGroupService extends BaseService {

    /**
     * 保存部门数据信息
     * @param sysGroup 部门数据对象
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/saveSysGroup")
    Map<String,Object> saveSysGroup(@RequestBody Map<String, Object> sysGroup);

    /**
     * 查询部门列表，（分层）
     * @param sysGroup 查询条件
     * @return  List<SysGroup>
     */
    @RequestMapping(contextPath + "/findLayeredSysGroupList")
    List<Map<String,Object>> findLayeredSysGroupList(@RequestBody Map<String, Object> sysGroup);


    /**
     * 查询部门列表
     * @param sysGroup 查询对象
     * @return List<SysGroup>
     */
    @RequestMapping(contextPath + "/findSysGroupList")
    List<Map<String,Object>> findSysGroupList(@RequestBody Map<String, Object> sysGroup);

    /**
     * 通过ID查询部门对象
     * @param id 部门ID
     * @return  SysGroup
     */
    @RequestMapping(contextPath + "/findSysGroupById")
    Map<String,Object> findSysGroupById(@RequestParam("id") BigDecimal id);
    /**
     * 修改部门状态
     * @param ids 部门ID串
     * @param status 状态，1正常，2禁用，3删除
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/updateSysGroupStatus")
    Map<String,Object> updateSysGroupStatus(@RequestParam("ids") String ids, @RequestParam("status") int status);

    /**
     * 修改部门的父级归属
     * @param id 部门ID
     * @param parentId 部门父ID
     */
    @RequestMapping(contextPath + "/updateSysGroupParentId")
    Map<String,Object> updateSysGroupParentId(@RequestParam("id") BigDecimal id,
                                              @RequestParam("parentId") BigDecimal parentId);
}
